import type { UserInfo } from '@/types/user'
import Mock from 'mockjs'
// 获取用户信息
Mock.mock('/api/user', 'get', () => {
  return {
    code: 200,
    success: true,
    message: '请求成功。',
    data: <UserInfo>{
      id: '1',
      username: 'admin',
      avatar: ''
    }
  }
})
// 获取左侧菜单
Mock.mock('/api/asideMenu', 'get', () => {
  return {
    code: 200,
    success: true,
    message: '请求成功。',
    data: <any>{
      menu: [
        {
          "index": "1",
          "title": "首页",
          "icon": "el-icon-house",
          "path": "/home"
        },
        {
          "index": "2",
          "title": "案例展示",
          "icon": "el-icon-user",
          "path": "/demo",
          "children": [
            {
              "index": "2-1",
              "title": "Echarts",
              "icon": "el-icon-document",
              "path": "/demo/echarts"
            },
            {
              "index": "2-2",
              "title": "Draggable-拖动",
              "icon": "el-icon-document",
              "path": "/demo/draggable"
            },
            {
              "index": "2-3",
              "title": "选项卡式tab",
              "icon": "el-icon-document",
              "path": "/demo/tab1"
            },
            {
              "index": "2-4",
              "title": "自动滚动",
              "icon": "el-icon-document",
              "path": "/demo/scroll"
            },{
              "index": "2-5",
              "title": "swiper-轮播图",
              "icon": "el-icon-document",
              "path": "/demo/swiper"
            },{
              "index": "2-6",
              "title": "animate-动画库",
              "icon": "el-icon-document",
              "path": "/demo/animate"
            },
            {
               "index": "2-7",
              "title": "svg",
              "icon": "el-icon-document",
              "path": "/demo/svg"
            }
          ]
        },

        {
          "index": "3",
          "title": "canvas",
          "icon": "el-icon-user",
          "path": "/threejs",
          "children": [
            {
              "index": "3-1",
              "title": "地图可拖动点位",
              "icon": "el-icon-document",
              "path": "/canvas/canvas1"
            },
            {
              "index": "3-2",
              "title": "地图轨迹展示",
              "icon": "el-icon-document",
              "path": "/canvas/canvas2"

            },
            {
              "index": "3-3",
              "title": "点位详情弹窗",
              "icon": "el-icon-document",
              "path": "/canvas/canvas3"
            },
            {
              "index": "3-4",
              "title": "点位可拖动，地图",
              "icon": "el-icon-document",
              "path": "/canvas/canvas4"
            }
          ]
        },
          {
          "index": "4",
          "title": "时间条拖动",
          "icon": "el-icon-user",
          "path": "/timeMouse",
          "children": [
            {
              "index": "4-1",
              "title": "一周时间选择",
              "icon": "el-icon-document",
              "path": "/timeMouse/mouse1"
            }
          ]
        },
        {
          "index": "5",
          "title": "threejs",
          "icon": "el-icon-user",
          "path": "/threejs",
          "children": [
            {
              "index": "5-1",
              "title": "第一个three3d",
              "icon": "el-icon-document",
              "path": "/threejs/three1"
            },
            {
              "index": "5-2",
              "title": "第二个three3d",
              "icon": "el-icon-document",
              "path": "/threejs/three2"
            },
            {
              "index": "5-3",
              "title": "第三个three3d",
              "icon": "el-icon-document",
              "path": "/threejs/three3"
            }
          ]
        },
        {
          "index": "6",
          "title": "算法测试",
          "icon": "el-icon-user",
          "path": "/code",
          "children": [
            {
              "index": "5-1",
              "title": "防抖节流",
              "icon": "el-icon-document",
              "path": "/code/code1"
            }
          ]
        },
        {
          "index": "7",
          "title": "NodeJs",
          "icon": "el-icon-user",
          "path": "/node",
          "children": [
            {
              "index": "5-1",
              "title": "防抖节流",
              "icon": "el-icon-document",
              "path": "/node/node1"
            }
          ]
        },
        {
          "index": "88",
          "title": "测试",
          "icon": "el-icon-",
          "path": "/ceshi"
        },
        {
          "index": "99",
          "title": "系统设置",
          "icon": "el-icon-setting",
          "path": "/settings"
        }
      ]
    }
  }
})